package expression;

import echecs.Etat;
import java.util.List;

public interface Expression<T> {

    T f(Etat etat);
}

abstract class LExpressionNaire implements Expression {

    protected final List<Expression> arg;

    public LExpressionNaire(List<Expression> arg) {
        this.arg = arg;
    }
}

abstract class ExpressionNaire implements Expression {

    protected final Expression[] arg;

    public ExpressionNaire(Expression[] arg) {
        this.arg = arg;
    }
}

abstract class ExpressionTernaire implements Expression {

    protected Expression arg1,  arg2,  arg3;

    public ExpressionTernaire(Expression arg1, Expression arg2, Expression arg3) {
        this.arg1 = arg1;
        this.arg2 = arg2;
        this.arg3 = arg3;
    }
}

abstract class ExpressionBinaire implements Expression {

    protected Expression arg1,  arg2;

    public ExpressionBinaire(Expression g, Expression d) {
        arg1 = g;
        arg2 = d;
    }
}

abstract class ExpressionUnaire implements Expression {

    protected Expression argument = null;

    void setArgument(Expression a) {
        argument = a;
    }
}















